package com.hdoit.ares.web.advertisement.modelconfig;
import com.hdoit.ares.web.advertisement.providers.OpenStateProvider;
import com.tennetcn.common.enums.regular.MathRegularExpressions;
import com.tennetcn.component.attribute.DateTimeAttribute;
import com.tennetcn.component.attribute.DisplayNameAttribute;
import com.tennetcn.component.attribute.DropDownListAttribute;
import com.tennetcn.component.attribute.RegularExpressionAttribute;
import com.tennetcn.component.attribute.base.ModelMetadataAttributeConfiguration;

/**
 * @author      yujinhui
 * @email       
 * @createtime  2018年03月13日 19:21:04
 * @comment
 */
public class AdvertisementLocationConfig extends ModelMetadataAttributeConfiguration{
    public AdvertisementLocationConfig(){
        this.setProperty("name")
            .hasAttribute(new DisplayNameAttribute("广告位名称"));

        this.setProperty("width")
            .hasAttribute(new DisplayNameAttribute("广告位的宽度"))
            .hasAttribute(new RegularExpressionAttribute(MathRegularExpressions.naturalNumber));

        this.setProperty("height")
            .hasAttribute(new DisplayNameAttribute("广告位高度"))
            .hasAttribute(new RegularExpressionAttribute(MathRegularExpressions.naturalNumber));

        this.setProperty("comment")
            .hasAttribute(new DisplayNameAttribute("广告位说明"));

        this.setProperty("isOpen")
            .hasAttribute(new DisplayNameAttribute("是否开放广告位"))
            .hasAttribute(new DropDownListAttribute(new OpenStateProvider()));

        this.setProperty("feature")
            .hasAttribute(new DisplayNameAttribute("广告位结构"));

        this.setProperty("createTime")
            .hasAttribute(new DisplayNameAttribute("创建时间"))
            .hasAttribute(new DateTimeAttribute());

    }
}